/**
 *	html/pem_data_system.js
 *
 *	(C) 2014 Yuanjj
 *
 * 	history:
 * 		2014-08-28		create the file
 */

/**
 *	initialize user data
 */
var g_host;
function init_host()
{
    Ext.define
    ("model_host_info", {
         extend:"Ext.data.Model",
         fields:[
             {name:"serial",		type:"int"},
             {name:"host",			type:"string"},
             {name:"name",			type:"string"},
             {name:"ip",			type:"string"},
             {name:"port",			type:"int"},
             {name:"status",		type:"int"},
         ]
    });

    g_host = new Ext.data.ArrayStore
    ({
         autoLoad:true,
         model:"model_host_info"
    });

}

/**
 *	callback for setting host
 *
 *	@serial			[in] host serial
 *	@host			[in] host id ( unquie )
 *	@name			[in] host name
 *	@ip				[in] host ip
 *	@port			[in] host port
 *	@status			[in] host status
 */
function callback_set_host( serial, host, name, ip, port, status )
{
    var index	= g_host.count();

    g_host.insert( index, [[serial, host, name, ip, port, status]] );
}
